﻿using Global.Globalcs;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

namespace PHZPNW.API
{
    public class GG
    {
        MSql msql = new MSql();
        public GG()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        public string[] GetGGinfo(string ggid,string uid)
        {
            string sql = "select * from F_GG where id = '"+ ggid + "'";
            DataSet ds = msql.Selbeck(sql);
            //更新查看次数
            sql = "update F_GG set ydcs = ydcs +1 where id = '" + ggid + "'";
            msql.Datachange(sql);
            //更新本人查看次数
            sql = "update U_GG set ydjl = ydjl +1 where ggid = '" + ggid + "' and uid = '" + uid + "'";
            msql.Datachange(sql);
            string[] fhxx = new string[2];
            fhxx[0] = ds.Tables[0].Rows[0]["bt"].ToString();
            fhxx[1] = ds.Tables[0].Rows[0]["nr"].ToString();
            return fhxx;
        }
    }
}